package com.zxn.school;

import java.util.Scanner;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/3/22 14:11
 * @description
 */
public class Test {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Dao dao = new Dao();
        while (true) {
            System.out.println("=======不知道叫啥名系统=======");
            System.out.println("1.添加老师\n" +
                    "2.添加学生\n" +
                    "3.查询所有学生(隐藏老师id)\n" +
                    "4.查询老师各自管理了多少学生\n" +
                    "5.查询学生属于哪个老师管理\n" +
                    "6.查询不及格的学生(<60)\n" +
                    "7.从高到低排列学生的成绩\n" +
                    "8.修改学生成绩\n" +
                    "9.开除学生\n" +
                    "0.退出系统");
            System.out.println("==========================");
            System.out.print("请输入菜单编号：(0-9):");
            int next = input.nextInt();
            switch (next){
                case 1:
                    dao.addTeacher();
                    break;
                case 2:
                    dao.addStudent();
                    break;
                case 3:
                    dao.findAllstu();
                    break;
                case 4:
                    dao.findStuofTea();
                    break;
                case 5:
                    dao.findTeaofStu();
                    break;
                case 6:
                    dao.findFail();
                    break;
                case 7:
                    dao.StuscoreforTea();
                    break;
                case 8:
                    dao.editStuscore();
                    break;
                case 9:
                    dao.reStu();
                    break;
                case 0:
                    System.out.println("===========已退出=========");
                    return;
                default:
                    System.err.println("输入错误");
                    break;
            }
        }


    }
}
